package cn.binarywang.tools.generator.event;

/**
 * <pre>
 * 车事故类型枚举类
 * @author liuf
 */
public enum CarEventTypeEnum {
    /**
     *
     */
    SPEED(1,  "Speed", "超速"),
    speeding_150(2,  "Speeding 150%", "超速150%"),
    failed_pedestrians(3,  "Failed to yield to pedestrians", "未礼让行人"),
    PARKING(4,  "parking", "违规停车"),
    SMUGGLING(5,  "smuggling", "违法运输"),
    RETROGRADE(6,  "retrograde", "走私"),
    TRANSPORTATION(7,  "Illegal transportation", "逆行"),
    ESCAPE(8,  "The escape", "逃逸"),
    DRUNKEN_DRIVING(9,  "Drunken driving", "酒驾"),
    _unknown(0,  "", "未知");

    private  int code;

    private  String name;
    private  String text;

    public static CarEventTypeEnum getCode(int code) {
        CarEventTypeEnum[] elements = CarEventTypeEnum.values();
        for (CarEventTypeEnum element : elements) {
            if (element.getCode() == code) {
                return element;
            }
        }
        return _unknown;
    }

    CarEventTypeEnum(int code, String name, String text) {
        this.code = code;
        this.name = name;
        this.text = text;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

}
